1. Field of the Invention
The present invention relates to an encoder wherein a vernier relationship is held between a code plate with alternating transparent and nontransparent parts and a sensor array for converting light transmitted through this code plate into electric signals.
2. Description of the Prior Art
An encoder has been developed which is designed to have a vernier relationship between a code plate with alternating transparent and nontransparent lattice parts and a sensor array for converting the light transmitted through the code plate into electric signals by arranging n lattice parts and (n+1) sensor elements within one block. By realizing the vernier relationship between the code plate and the sensor array, the effective precision of measurement of the distance of the relative displacement may be improved to 1/(n+1) of the lattice width of the code plate.
This vernier relationship can also be performed by determining the sum of the widths of the transparent and nontransparent lattice parts as a minimum unit and by determining the width of two sensor elements as a minimum detecting unit.
A case will be described wherein such a measuring principle is applied to an linear scale encoder reference to the accompanying drawings. FIG. 1 shows the schematic construction of such an encoder wherein a code plate 1 has a lattice pattern in which the transparent and nontransparent parts are alternately arranged. Light emitted from a lamp 2 is irradiated on this code plate 1 after being refracted into parallel light rays by a lens 3. The light which has passed through the code plate 1 forms an image representing the lattice pattern on a line sensor 5 through an objective lens 4. The line sensor 5 comprises, for example, a plurality of photocells which are arranged parallel to the code plate 1 and which output electric signals of an amplitude corresponding to the intensity of light incident on the respective photocells as time serial signals.
The code plate 1 and the line sensor 5 are used, for example, as an encoder for measuring the relative displacement of a cutting tool and a workpiece mounted on a tool slide and as parts slide of an NC machine. FIG. 2 shows on an enlarged scale the relative positions of the code plate 1 and the line sensor 5 at a certain moment. In FIG. 2(a), a transparent part 1-1 and a nontransparent part 1-2 of the code plate 1 have the same width, and the total width of the two parts 1-1 and 1-2 will be designated as period W. This period W is the minimum unit of the lattice pattern. A total of N units are included in a length L, defining one block. The line sensor 5, as shown in FIG. 2(b), comprises 2(N+1) photocells in the block of length L. The total period M of two photocells is slightly smaller than the minimum unit period W of the lattice pattern. In FIG. 2, N=10, so 22 photocells are used. This period M will be designated to be the minimum unit of the sensor array. A total of N+1 units is included in the length L defining one block.
FIG. 2(c) shows the outputs of the respective photocells in this conditions when the parallel light rays are incident on the code plate 1 from above. For example, in a photocell 5-1, since the light is incident on its entire photosensitive area through the transparent part 1-1, its output level becomes 10. At the adjacent photocell 5-2, since most of the light is blocked by the nontransparent part 1-2, the output level is substantially 0. Half of the photosensitive area of a photocell 5-6 is not irradiated with light due to a nontransparent part 1-6, so its output level becomes 5. An envelope X of the outputs of the photocells of odd numbers within one block, 5-1, 5-3, . . . 5-21, is a triangular waveform of period T which reaches a maximum at the photocell 5-1 and reaches a miminum at the photocell 5-11. An envelope Y of the outputs of photocells of even numbers, 5-2, 5-4, . . . 5-22, is a triangular waveform of period T which reaches a minimum at the photocell 5-22 and reaches a maximum at the photocell 5-12. The envelopes X and Y have two intersections (Z1, Z2) within the period T. Referring to FIG. 2, when the code plate 1 and the line sensor 5 are transversely displaced relative to each other, the output change repeats with a pattern period W of one cycle. This indicates that the relative displacement W between the code plate 1 and the line sensor 5 is translated, in an enlarged scale, into an output change of the 22 photocells 5-1 to 5-22.
FIG. 3 shows the manner in which the intersections Z1 and Z2 of the output envelopes X and Y of the line sensor photocells of odd and even numbers are displaced on the line sensor 5 according to the relative displacement of the code plate 1 and the sensor 5. The unit displacement S0 is represented as EQU S0=W/2(N+1)=W/22
Accordingly, the displacement of the intersections Z1 and Z2, that is, the relative displacement S of the code plate 1 and the line sensor 5, may be represented as EQU S=mS0(m=1, 2, . . . 22)
Therefore, by detecting the position of the intersection Z1 or Z2 on the line sensor 5, the pattern period W may be interpolated with a precision of 1/2(N+1).
In order to detect the intersections Z1 and Z2 of the envelopes of the outputs of the photocells of odd and even numbers, the outputs of the respective photocells are separated into two signal sequences and are passed to two envelope detectors. The output levels of these two envelope detectors are compared to determine the point at which both outputs are at the same level. Since the intersections Z1 and Z2 move the same distance for a single relative displacement of the code plate 1 and the line sensor 5, only one of them need be detected for a period T. For example, referring to FIG. 2(c), the range within which the envelope X is larger than the envelope Y(X&gt;Y) is defined as the positive phase, the range within which X&lt;Y is defined as the negative phase, and only the intersection Z1 making the transition from the positive to the negative phase needs to be considered. This intersection Z1 is counted by clock pulses synchronous with the scanning operations of the line sensor 5 starting from an arbitrary photocell. It is apparent that this counted value represents the displacement S of the code plate 1 relative to the line sensor 5 as mS0{m: 1,2 . . . 2(N+1)} within the range of W.
As the encoder, in addition to the interpolation described above, readout of upper significant digits, that is, at the minimum unit of half (W/2) of the period W of the code plate 1 is also necessary. Now the output of a particular photocell of the line sensor 5 is considered. When the line sensor 5 relatively moves with respect to the code plate 1, the output of this particular photocell at each scanning becomes the sinusoidal waveform having the lattice pattern period W as the period. This output of the particular photocell is sampled and held and converted into a pulse signal with a duty cycle of 50%. By counting the leading and trailing edges of this pulse signal, coarse reading of the minimum unit of W/2 may be accomplished.
An encoder for reading the relative displacement of the code plate 1 and the line sensor 5 may be obtained by combining the coarse reading of the W/2 unit and the fine reading obtained by the interpolation of the W/2(N+1) unit described above.
FIG. 4 shows an example of the circuit configuration of an encoder realizing the operation principle described above. The code plate 1 and the line sensor 5 shown in FIG. 4 are in the relative positions shown in FIG. 5. The light emitted from the lamp 2 shown in FIG. 4 is refracted into uniform parallel light rays by the lens 3. The light rays are then irradiated on the code plate 1. The pattern of the code plate 1 is formed as an image on the line sensor 5 by the lens 4. As a result, the waveform of the time serial output signal obtained from the line sensor 5 becomes as shown in FIG. 6(a).
The time serial output signal as shown in FIG. 6(a) obtained from the line sensor 5 is amplified to a predetermined level by an amplifier 6 and is thereafter supplied to a sampling and holding circuit 7 and to a signal distributor 8. For the coarse reading of the W/2 minimum unit, the output of the sampling and holding circuit 7 is used. The sampling and holding circuit 7, in response to a sampling signal generated by a drive circuit, that is, a signal generating circuit 9, samples and holds the output of a particular photocell in the line sensor 5 once for energy scanning operation of the line sensor 5. The envelope of the output of this particular photocell which is held is detected by an envelope detector 10. The detector 10 outputs a sinusoidal wave having the period W of the sensor array as a period thereof. The sinusoidal output of the envelope detector 10 is supplied to a Schmitt trigger circuit 11 to be converted into a square wave at a suitable slice level, for example, 50% level. The leading and trailing edges of the output of the Schmitt trigger circuit 11 are counted by a counter 12, and a signal representing the coarse reading counted value is supplied to a converting circuit 13.
The time serial signal shown in FIG. 6(a) supplied to the signal distributor 8 are used for fine reading. This signal distributor 8 is adopted for distributing the outputs of the odd-numbered photocells, 5-1, 5-3, . . . 5-21, and the outputs of the even-numbered photocells, 5-2, 5-4, . . . 5-22, of the line sensor 5 into two sequences of time serial signals. For this purpose, the distributor 8 need only comprise a simple gate circuit. Distribution into two sequences of time serial signals may be accomplished by receiving the clock pulses from the drive circuit 9 at a flip-flop, for example, and gating the input time serial signals by Q and Q outputs from the flip-flop which alternately become "1" and "0". The two sequences of signals distributed by the distributor 8 are supplied to envelope detectors 14 and 15, respectively, for detection of the envelopes. Consequently, the outputs of odd-numbered photocells, 5-1, 5-3, . . . 5-21, are detected by the detector 14 to provide an envelope signal X as shown in FIG. 6(b). The outputs of the even-numbered photocells, 5-2, 5-4, . . . 5-22, are detected by the detector 15 to provide an envelope signal Y as shown in FIG. 6(c). These signals X and Y are compared at a comparator 16 to determine their level difference. The comparator 16 includes, for example, a differential amplifier having the X signal supplied to its positive input terminal and the Y signal applied to its negative input terminal. Then, as shown in FIG. 6(d), a coincidence signal is output only at the intersection Z1 at which the polarity of the differential amplifier output changes from plus to minus and the levels of the signals are the same and the phase changes from the positive phase (X&gt;Y) to the negative phase (X&lt;Y). This coincidence signal is supplied to a counter 17. Then, the counter 17 outputs to the converting circuit 13 a count output signal of the clock pulses generated from the starting point of the scanning of the line sensor 5. The results of the coarse and fine readings thus obtained are corrected and converted into an actual displacement by the converting circuit 13, and the result is digitally displayed at a display device 18.
The method for correction will now be described. When the line sensor 5 and the code plate 1 are displaced relative to each other from the positions shown in FIG. 5, the first photocell 5-1 is assumed to be used for coarse reading. When the code plate 1 shown in FIG. 5 is displaced relative to the line sensor 5 in the direction shown by arrow, the first photocell 5-1 is coarsely counted for each boundary between the transparent and nontransparent parts, e.g., the boundary between the transparent part 1-1 and the nontransparent part 1-2 of the code plate 1, between 1-2 and 1-3, and so on.
Upon the displacement of the code plate 1 by the distance W in the direction of the arrow, the reading of the vernier changes from S=0 to S=22S0. During the time the reading of the vernier changes from S=0 to S=22S0, coarse reading becomes 0 within the range of 0 to W/4, and 1 within the range of W/4 to 3W/4. When the boundary between the transparent part 1-1 and the nontransparent part 1-2 passes that left end part of the photocell 5-1 shown in the figure, the reading changes from 0 to 1. However, since the displacement of the code plate 1 is W/4 in this case, an error of W/2 is included in the measurement unless the coarse reading is made 0. When the coarse reading is at the boundary between 0 and 1, the fine reading is about 6/22. Thus, the coarse reading is set to 0, irrespective of the coarse reading of 0 or 1. When the coarse reading is at the boundary between 1 and 2, the fine reading is about 17/22. Thus, the coarse reading is also set to 0. That is, when the coarse reading is an odd number, the incremented accumulated reading is decremented by 1. When the coarse reading is an even number and the fine reading is smaller than 11/22, the value may remain unchanged. When the coarse reading is an even number and the fine reading is larger than 11/22, the accumulated reading is decremented by 2. The results as obtained in this manner are shown in Table 1 below.
TABLE 1 ______________________________________ Coarse reading 0 or 1 1 or 2 2 or 3 3 or 4 4 or 5 5 or 6 Fine reading 6/22 17/22 6/22 17/22 6/22 17/22 ______________________________________ Coarse 0 0 2 2 4 4 reading after correc- tion Displacement 6/22 17/22 ##STR1## ##STR2## ##STR3## ##STR4## ______________________________________
With an encoder of the construction shown in FIG. 4, vibrations, shrinkage and deformation of the code plate 1 and the line sensor 5 due to changes in temperature and changes in the magnifications of the lens 4 contribute to degradation in the measurement precision.
For example, when a position displacement detection system comprising the code plate 1 and the line sensor 5 are constructed as shown in FIG. 7A, the relative relationship of a pair of lenses 4a and 4b and the line sensor 5 along the optical path of the incident light is important. This relative relationship defines the vernier relationship between the code plate 1 and the line sensor 5. When any slight error in position is caused in this position displacement detection system due to changes in the ambient temperature, vibrations and so on, the vernier relationship set during design and manufacture is disturbed, resulting in reading errors.
Referring to FIG. 7B, the ordinate indicates the vernier base N and the abscissa indicates the rate of change (%) when the magnification of the pattern image of the code plate 1 projected on the sensor 5 has changed for the reasons described above from that of the initially set condition in which the vernier relationship is WN=M(N+1) where N=10 and the pitch of the photocell on the line sensor is 10 .mu.m. According to FIG. 7B, when the rate of change of the magnification changes by 1%, N changes by about 10%. Therefore, when reading is performed involving a scale position spaced apart from the origin of the interpolated scale, the error between the reading and the true value becomes greater.
In order to manufacture an encoder which will maintain high precision regardless of external conditions such as temperature changes, vibrations and so on, the manufacturing errors of various parts must be minimized. This presents a number of problems including lower manufacturing yield, higher manufacturing cost, requirement of precise adjustment during assembly, and so on.